package com.dragon.modules.yuegou.query.act;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.act.SignInEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 年会签到 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2020-01-14 20:49:56
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class SignInQuery extends SignInEntity implements Query<SignInEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 会员ID查询条件 */
	@JsonUnwrapped(prefix = "memberId")
	private Condition<String> memberIdCondition;

    /** 手机号查询条件 */
	@JsonUnwrapped(prefix = "mobile")
	private Condition<String> mobileCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public SignInQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public SignInQuery(SignInEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public SignInQuery(SignInQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.memberIdCondition != null) {
			this.memberIdCondition = other.memberIdCondition.copy();
		}
		if(other.mobileCondition != null) {
			this.mobileCondition = other.mobileCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<SignInEntity> toQueryWrapper() {
		QueryWrapper<SignInEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (memberIdCondition != null) {
			memberIdCondition.toWrapper(wrapper, COL_MEMBER_ID);
		}
		if (mobileCondition != null) {
			mobileCondition.toWrapper(wrapper, COL_MOBILE);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回会员ID查询条件
	 * 
	 * @return memberIdCondition 会员ID查询条件
	 */
	public Condition<String> memberId() {
		this.memberIdCondition = new Condition<>();
		return this.memberIdCondition;
	}
	
	/**
	 * 获取会员ID查询条件
	 * 
	 * @return memberIdCondition 会员ID查询条件
	 */
	public Condition<String> getMemberIdCondition() {
		return memberIdCondition;
	}

	/**
	 * 设置会员ID查询条件
	 * 
	 * @param memberIdCondition 会员ID查询条件
	 */
	public void setMemberIdCondition(Condition<String> memberIdCondition) {
		this.memberIdCondition = memberIdCondition;
	}

	/**
	 * 构造并返回手机号查询条件
	 * 
	 * @return mobileCondition 手机号查询条件
	 */
	public Condition<String> mobile() {
		this.mobileCondition = new Condition<>();
		return this.mobileCondition;
	}
	
	/**
	 * 获取手机号查询条件
	 * 
	 * @return mobileCondition 手机号查询条件
	 */
	public Condition<String> getMobileCondition() {
		return mobileCondition;
	}

	/**
	 * 设置手机号查询条件
	 * 
	 * @param mobileCondition 手机号查询条件
	 */
	public void setMobileCondition(Condition<String> mobileCondition) {
		this.mobileCondition = mobileCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdTimeCondition 查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

}
